package com.taa.controller;

import com.taa.entity.Product;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @Author: taa
 * @Desc: 商品控制器
 * @Create: 2025-06-14 18:48
 **/
@RestController
@RequestMapping("/provider")
public class ProductController {
    private final List<Product> products = Arrays.asList(
            new Product(1L, "iPhone 15", 7999.0),
            new Product(2L, "MacBook Pro", 12999.0)
    );

    @GetMapping("/products")
    public List<Product> listProducts() {
        return products;
    }
}

